//
//  TabBarButton.m
//  MyProject
//
//  Created by Pei on 16/6/19.
//  Copyright © 2016年 Xiaobo Pei. All rights reserved.
//
#import "TabBarButton.h"
//#import "JackTool.h"

@implementation TabBarButton

- (id)init {
    
    if (self = [super init]) {
        
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
}

//- (void)setCorner {
//    [self.layer setCornerRadius:2];
//    [self.layer setMasksToBounds:YES];
//}

//登录／注册页  按钮
- (void)setFrame:(CGRect)frame title:(NSString *)text target:(id)obj action:(SEL)sel
{
    self.frame = frame;
    [self setTitle:text forState:UIControlStateNormal];
    [self addTarget:obj action:sel forControlEvents:UIControlEventTouchUpInside];
    self.titleLabel.font = kAppFont(Button_Font_Size);
    //[self setCorner];
    
    [self setTitleColor:kGreenColor forState:UIControlStateDisabled];
    [self setTitleColor:kGreenColor forState:UIControlStateNormal];
    [self setTitleColor:kBlueColor forState:UIControlStateHighlighted];
    
    //[self setBackgroundImage:[JackTool imageWithColor:[UIColor blueColor]] forState:UIControlStateDisabled];
    //[self setBackgroundImage:[JackTool imageWithColor:[UIColor blueColor]] forState:UIControlStateNormal];
    //[self setBackgroundImage:[JackTool imageWithColor:[UIColor blueColor]] forState:UIControlStateHighlighted];
}

//其它 下一步按钮
- (void)setNextFrame:(CGRect)frame title:(NSString *)text target:(id)obj action:(SEL)sel
{
    
}

- (void) setNormalImage:(UIImage *)image {
    self.backgroundColor = [UIColor clearColor];
    [self setImage:image forState:UIControlStateNormal];
}
- (void) setSelectedImage:(UIImage *)image {
    self.backgroundColor = [UIColor clearColor];
    [self setImage:image forState:UIControlStateSelected];
}
- (void) setDisabledImage:(UIImage *)image {
    
    [self setImage:image forState:UIControlStateDisabled];
}

- (void)setEnabled:(BOOL)enabled{
    if (enabled) {
        self.backgroundColor = kBlueColor;//[UIColor redColor];
    }else{
        self.backgroundColor = kGreenColor;//[UIColor blueColor];
    }
    [super setEnabled:enabled];
    
}
@end
